/*
*************************************
* PocketGTT
*************************************
This file is part of PocketGTT.

PocketGTT is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.

PocketGTT is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU General Public License for more details.

You should have received a copy of the GNU General Public License
along with PocketGTT.  If not, see <http://www.gnu.org/licenses/>.
*/

import QtQuick 1.0

Rectangle {

    id: head
    height: titleText.height + mybar.height + sep1.height + 10  + 20 // + sep2.height
    color: "transparent"

    Item {
        id: titleText
        width: parent.width
        height: sTitle.height + sStreet.height + 11
        anchors.bottom: sep1.top
        //        color: "transparent"


        Text {
            id: sTitle
            text: myWin.statesMan.fermata.FermataNumero + " - " + myWin.statesMan.fermata.FermataNome
            horizontalAlignment: Text.AlignHCenter
            anchors.top: parent.top
            anchors.topMargin: 5
            anchors.bottomMargin: 3
            anchors.horizontalCenter: parent.horizontalCenter
            color: myWin.theme.violet_background //"yellow"
            elide: Text.ElideRight
            width: parent.width * 0.95
            font.pixelSize: myWin.theme.textSizeB  //44
        }
        Text {
            id: sStreet
            text: myWin.statesMan.fermata.FermataIndirizzo
            horizontalAlignment: Text.AlignHCenter
            anchors.top: sTitle.bottom
            anchors.topMargin: 3
            anchors.horizontalCenter: parent.horizontalCenter
            color: "white"
            elide: Text.ElideRight
            width: parent.width * 0.95
            font.pixelSize: myWin.theme.textSizeM //24
            //            wrapMode: Text.Wrap
        }

    }

    Separator {
        id: sep1
        anchors.bottom: mybar.top
        anchors.topMargin: 5
        anchors.bottomMargin: 5
        anchors.horizontalCenter: parent.horizontalCenter
    }

    PassaggiViewSwitchBar {
        id: mybar
        anchors.bottom: parent.bottom
        //anchors.fill: parent
        width: parent.width
        height: 80
        //qrc:/main.qml
        //        myImageSource: "qrc:switch_l.png"
        //offImageSource: "switch_r.png"
    }

    //*************
    // Removed height status change
    //
    //    states: State {
    //        name: "map"
    //        PropertyChanges { target: head; height: mybar.height  } //+ sep2.height
    //        when: myWin.statesMan.pageview_map
    //    }
    //    transitions: Transition {
    //        NumberAnimation { target: head; property: "height"; duration: 300 }
    //    }
}
